-
Notifications
You must be signed in to change notification settings - Fork 6.1k
Document default 75% value for GCHeapHardLimitPercent in container environments #50280
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
…vironments Co-authored-by: agocke <[email protected]>
|
@copilot I believe this would read better as: |
|
@copilot I believe this would read better as: |
Co-authored-by: agocke <[email protected]>
agocke
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot please address
|
|
||
| - The heap hard limit is defined as the maximum commit size, in bytes, for the GC heap and GC bookkeeping. | ||
| - This setting only applies to 64-bit computers. | ||
| - If this limit isn't configured but the process is running in a memory-constrained environment, that is, inside a container with a specified memory limit, a default value is set. That default is the greater of 20 MB or 75% of the memory limit on the container. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm actually not sure this is correct. If this were true, then setting GCHeapHardLimitPercent to, say, 90% inside of a container would be equal to .75 * .9 * x = .675x, but it's actually .9x. I think we should instead note that inside a container the GCHeaphardLimitPercent has a different default value (and point to that section)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated line 303 to reference the heap hard limit percent section instead of duplicating the 75% value. This centralizes the default value documentation in GCHeapHardLimitPercent and clarifies the relationship. Commit d6dd0eb.
… duplicating Co-authored-by: agocke <[email protected]>
|
@mangod9 for review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR improves the garbage collector configuration documentation by centralizing the default 75% memory limit documentation for container environments. The change moves the explicit percentage from the "Heap hard limit" section to the "Heap hard limit percent" section where it logically belongs, and creates a cross-reference to avoid duplication.
Key changes:
- Centralized the 75% default value documentation in the "Heap hard limit percent" section
- Updated the "Heap hard limit" section to reference the percentage section instead of duplicating the value
| - The heap hard limit is defined as the maximum commit size, in bytes, for the GC heap and GC bookkeeping. | ||
| - This setting only applies to 64-bit computers. | ||
| - If this limit isn't configured but the process is running in a memory-constrained environment, that is, inside a container with a specified memory limit, a default value is set. That default is the greater of 20 MB or 75% of the memory limit on the container. | ||
| - If this limit isn't configured but the process is running in a memory-constrained environment, that is, inside a container with a specified memory limit, a default value is set. That default is the greater of 20 MB or the [heap hard limit percent](#heap-hard-limit-percent) of the memory limit on the container. |
Copilot
AI
Dec 3, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The phrase "the heap hard limit percent of the memory limit on the container" is ambiguous. "Heap hard limit percent" is a setting name, not a value, so this phrasing suggests using a setting name in a calculation. Consider: "That default is the greater of 20 MB or the default percentage from Heap hard limit percent (75%) applied to the memory limit on the container." This clarifies that it's using the default percentage value from that setting.
| - If this limit isn't configured but the process is running in a memory-constrained environment, that is, inside a container with a specified memory limit, a default value is set. That default is the greater of 20 MB or the [heap hard limit percent](#heap-hard-limit-percent) of the memory limit on the container. | |
| - If this limit isn't configured but the process is running in a memory-constrained environment, that is, inside a container with a specified memory limit, a default value is set. That default is the greater of 20 MB or the default percentage from [Heap hard limit percent](#heap-hard-limit-percent) (75%) applied to the memory limit on the container. |
| ### Heap hard limit percent | ||
|
|
||
| - Specifies the heap hard limit as a percentage of the total physical memory. If the process is running in a memory-constrained environment, that is, inside a container with a specified memory limit, the total physical memory is the memory limit; otherwise it's what's available on the machine. | ||
| - Specifies the heap hard limit as a percentage of the total physical memory. If the process is running in a memory-constrained environment, that is, inside a container with a specified memory limit, the container limit is considered the total physical memory. If in a memory-constrained environment, the default value is 75%. |
Copilot
AI
Dec 3, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The phrase "If in a memory-constrained environment" is a sentence fragment that creates grammatical confusion. The sentence should be rewritten for clarity. Consider: "When in a memory-constrained environment and this setting isn't explicitly configured, the default value is 75%." This provides better flow and clarifies that 75% is the default when the setting is not specified.
|
|
||
| - Specifies the heap hard limit as a percentage of the total physical memory. If the process is running in a memory-constrained environment, that is, inside a container with a specified memory limit, the total physical memory is the memory limit; otherwise it's what's available on the machine. | ||
| - Specifies the heap hard limit as a percentage of total physical memory. | ||
| - If the process runs inside an environment (e.g., a container) with a set memory limit, that limit is treated as the total physical memory. In such environments, the default value is 75%. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| - If the process runs inside an environment (e.g., a container) with a set memory limit, that limit is treated as the total physical memory. In such environments, the default value is 75%. | |
| - If the process runs inside an environment with a set memory limit (for example, a container), that limit is treated as the total physical memory. In such environments, the default value is 75%. |
Summary
Updated the garbage collector documentation to properly document the default 75% memory limit behavior in container environments:
This centralizes the default percentage documentation in one place (
GCHeapHardLimitPercent) and references it from theGCHeapHardLimitsection, avoiding potential confusion about how the values interact.Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.
Internal previews